<?php


namespace app\user\controller;

use app\common\controller\User;

/**
 * 会员中心
 * Class Index
 * @package app\user\controller
 */
class Index extends User
{
    /**
     * @return mixed
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function index()
    {
        $user = model('User')
            ->relation('money')
            ->where(['id' => $this->uid])
            ->find();

        $this->assign('user', $user);

        //冻结中
        $list = model('BorrowInvest')
            ->where(['invest_uid' => $this->uid, 'status' => 1])
            ->order('id DESC')
            ->select();

        $this->assign('list', $list);

        return $this->fetch();
    }


}
